﻿using System;

namespace Trial
{
    class Program
    {
        static void Main(string[] args)
        {
            Animal animal = new Eagle();
            Bird animal2 = new Eagle();
            Eagle animal3 = new Eagle();
            Write(animal);
            Write(animal2);
            Write(animal3 as IAnimal);
            Write(animal3 as Eagle);
            Console.ReadLine();
        }

        public static void Write(IAnimal animal)
        {
            Console.WriteLine("{0}-{1}", animal.GetType().ToString(), animal.Die());
        }

        public static void Write(Animal animal)
        {
            Console.WriteLine("{0}-{1}", animal.GetType().ToString(), animal.Die());
        }

        public static void Write(Bird animal)
        {
            Console.WriteLine("{0}-{1}", animal.GetType().ToString(), animal.Die());
        }

        public static void Write(Eagle animal)
        {
            Console.WriteLine("{0}-{1}", animal.GetType().ToString(), animal.Die());
        }
    }
}
